<template>
	<view>
		<view :class="item.clicked==1?'user-card-clicked':'user-card'" v-for="(item,index) in dataList"
			@click.stop="selected(index)">
			<view class="cover">
				<view class="info">
					<view class="text-1" style="margin-top: 19px;margin-bottom: 15px;">{{item.modelName}}</view>
					<!-- <view class="text-2" style="visibility: hidden;">描述: <text class="before1">{{item.modelDescription}}</text></view> -->
					
					<view class="price"  v-if="item.modelPrice==null||item.modelPrice==''"style="margin-top: 14px;margin-bottom: 19px;">敬请期待</view>
					<view class="price" v-else style="margin-top: 14px;margin-bottom: 19px;">￥{{item.modelPrice}}<text
							class="before" style="font-size: 12px;">起</text></view>
				</view>
				<!-- <image mode="aspectFit" class="img"
					:src="item.imageOrderCover||'@appstatic/img/my/appoint_img_small.png'"/> -->
					<image mode="aspectFill" class="img"  v-if="item.modelName=='引力'"
						src="@appstatic/car/gravitation_m.png"/>
						<image mode="aspectFit" class="img"  v-else-if="item.modelName=='星舰3'"
							src="@appstatic/car/starShip_m.png"/>
							<image mode="aspectFit" class="img" v-else
								:src="item.imageOrderCover||'@appstatic/img/my/appoint_img_small.png'"/>
			</view>
		</view>
		<view v-if="dataList.length==0">
			<view class='img-box'>
			  <image class='emptyImage' src='@appstatic/img/my/my_order_no_data.png'></image>
			  <view class='text'>暂无数据</view>
			</view>
		</view>


	</view>
</template>

<script>
	export default {
		name: "carSeries",
		props: {
			carTypeList: {
				type: Array,
				default: () => {
					return []
				}
			}

		},
		data() {
			return {

			};
		},
		computed: {
			dataList: {
				get() {
					for (var i = 0; i < this.carTypeList.length; i++) {
						if (this.carTypeList[i].clicked == 1) {
							this.$emit('carTypeItem_watch', this.carTypeList[i])
						}
					}
					return this.carTypeList
				},
				set(v) {

				}

			}
		},
		methods: {
			selected: function(index) {
				for (var i = 0; i < this.dataList.length; i++) {
					if (index == i) {
						this.dataList[i].clicked = 1
						this.$emit('carTypeItem', this.dataList[i])
					} else {
						this.dataList[i].clicked = 0
					}

				}

			},


		},
		options: {
			styleIsolation: 'shared',
			addGlobalClass: true
		},
	}
</script>

<style lang='scss' scoped>
	.user-card-clicked {
		width: calc(100% - 30px);
		margin-top: 20rpx;
		height: 160px;
		margin-left: 15px;
		clip-path: polygon(15px 0, calc(100% - 15px) 0,

				100% 0px, 100% calc(100% - 15px),

				calc(100% - 15px) 100%, 0px 100%,

				0 calc(100% - 15px), 0 15px);

		background: linear-gradient(-45deg, #EA5404 10px, #EDEDED 0) bottom right,

			linear-gradient(45deg, #EA5404 0px, #EDEDED 0) bottom left,

			linear-gradient(135deg, #EA5404 10px, #EDEDED 0) top left,

			linear-gradient(-135deg, #EA5404 0px, #EDEDED 0) top right;

		background-size: 52% 52%;
		background-repeat: no-repeat;
		border: solid 2px #EA5404;


	}

	.user-card {
		width: calc(100% - 30px);
		margin-top: 20rpx;
		height: 160px;
		margin-left: 15px;
		clip-path: polygon(15px 0, calc(100% - 15px) 0,

				100% 0px, 100% calc(100% - 15px),

				calc(100% - 15px) 100%, 0px 100%,

				0 calc(100% - 15px), 0 15px);

		background: linear-gradient(-45deg, #EDEDED 10px, #EDEDED 0) bottom right,

			linear-gradient(45deg, #EDEDED 0px, #EDEDED 0) bottom left,

			linear-gradient(135deg, #EDEDED 10px, #EDEDED 0) top left,

			linear-gradient(-135deg, #EDEDED 0px, #EDEDED 0) top right;

		background-size: 52% 52%;
		background-repeat: no-repeat;
		border: solid 2px #EDEDED;


	}

	.cover {
		width: 100%;
		height: 160px;
		z-index: 2;
		display: flex;

	}



	.info {
		width: calc(100% - 180px);
		height: 100%;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: center;
		margin-left: 30px;
	}

	.text-1 {
		font-family: 'Arial';
		font-style: normal;
		font-weight: 700;
		font-size: 18px;
		line-height: 21px;
		display: flex;
		align-items: center;
		color: #3D3A3A;
	}

	.text-2 {
		font-family: 'Noto Sans CJK SC';
		font-style: normal;
		font-weight: 400;
		font-size: 14px;
		line-height: 21px;

		display: flex;
		align-items: center;

		color: #333333;

		opacity: 0.4;
	}


	.price {
		font-style: normal;
		font-weight: 400;
		font-size: 14px;
		line-height: 18px;
		display: flex;
		align-items: center;
		color: #3D3A3A;
	}


	.before:before {
		content: " ";
		white-space: pre;

	}

	.before1:before {
		content: "   ";
		white-space: pre;

	}

	.img {
		width: 180px;
		height: 160px;
		clip-path: polygon(0px 0, calc(100% - 15px) 0,

				100% 0px, 100% calc(100% - 15px),

				calc(100% - 15px) 100%, 0px 100%,

				0 calc(100% - 15px), 0 15px);
	}
	.nodata{
		margin: 16px;
		font-family: 'Noto Sans SC';
		font-style: normal;
		font-weight: 400;
		font-size: 14px;
		line-height: 20px;
		display: flex;
		align-items: center;
		text-align: center;
		color: #ADB0AE;
	}
	.img-box {
	  width: 100vw;
	  /* margin-left: calc(50% - 150rpx); */
	  display: flex;
	  flex-direction: column;
	  align-items: center;
	}
	.emptyImage{
	  width: 300rpx;
	  height: 300rpx;
	  margin-top: 50px;
	}
	.text {
	  text-align: center;
	  font-size: 28rpx;
	  line-height: 5px;
	  color: #ADB0AE;
	}
</style>
